<?php
$conUrl = Yii::$app->params['base_url'];
?>
<div class="index_header">
  <main>
    <div class="header clear">
      <div class="left h0">
        <span>欢迎您访问</span>
        <div>
          <p @click.stop='toHome()'>
            家居加盟宝
          </p>
        </div>
      </div>
      <ul class="left h1">
        <li>
          <a href="javascript:void(0)">首页</a>
        </li>
        <li>
          <a href="<?= $conUrl ?>/brand">品牌馆</a>
        </li>
        <li>
          <a href="<?= $conUrl ?>/join">代理加盟</a>
        </li>
        <li>
          <a href="<?= $conUrl ?>/news">行业资讯</a>
        </li>
        <li>
          <a href="<?= $conUrl ?>/optimal">品牌严选</a>
        </li>
        <li>
          <a href="<?= $conUrl ?>/recruit">行业招聘</a>
        </li>
        <li>
          <a href="<?= $conUrl ?>/project">加盟分析</a>
        </li>
      </ul>
      <div class="right h2"></div>
      <div class="ewm">
        <img src="../public/image/xcx_code.png" alt="" class="inner_shadow"/>
      </div>
    </div>
  </main>
</div>
<div style="background: rgb(242, 242, 242); padding-bottom: 10px;">
  <?php if (!empty($top_ad_data)): ?>
    <?php foreach ($top_ad_data as $v): ?>
      <?php if ($v['activity_type'] == 1): ?>
        <div class="one_adv">
          <main>
            <p <?php if((empty($v['activity_data'][0]['is_ad']))):?>class="advert"<?php endif;?>>
              <a <?php if((empty($v['activity_data'][0]['url']))):?>href="javascript:void(0)"<?php else:?>href="<?= $v['activity_data'][0]['url'] ?>"<?php endif;?> target="_blank">
                <img src="<?= $v['activity_data'][0]['cover'] ?>" alt=""/>
              </a>
            </p>
          </main>
        </div>
      <?php elseif ($v['activity_type'] == 2): ?>
        <div class="two_adv">
          <main>
            <div class="two_adv_wrapper">
              <?php foreach ($v['activity_data'] as $v1): ?>
                <p <?php if((empty($v['activity_data'][0]['is_ad']))):?>class="advert"<?php endif;?>>
                  <a <?php if((empty($v1['url']))):?>href="javascript:void(0)"<?php else:?>href="<?= $v1['url'] ?>"<?php endif;?> target="_blank">
                    <img src="<?= $v1['cover'] ?>" alt=""/>
                  </a>
                </p>
            <?php endforeach ?>
            </div>
          </main>
        </div>
      <?php elseif ($v['activity_type'] == 5): ?>
        <div class="five_adv">
          <main>
            <ul>
              <?php foreach ($v['activity_data'] as $v1): ?>
                <a <?php if((empty($v1['url']))):?>href="javascript:void(0)"<?php else:?>href="<?= $v1['url'] ?>"<?php endif;?> target="_blank">
                  <li class="inner_shadow">
                    <div class="adv_wrapper" style="background:url('<?= $v1['cover'] ?>');"></div>
                  </li>
                </a>
              <?php endforeach ?>
            </ul>
          </main>
        </div>
      <?php elseif ($v['activity_type'] == 7): ?>
        <div class="seven_adv">
          <main>
            <div class="seven_adv_wrapper clear">
              <?php foreach ($v['activity_data'] as $v1): ?>
                  <p class="pic inner_shadow">
                    <a <?php if((empty($v1['url']))):?>href="javascript:void(0)"<?php else:?>href="<?= $v1['url'] ?>"<?php endif;?> target="_blank">
                      <img src="<?= $v1['cover'] ?>" alt=""/>
                    </a>
                  </p>
              <?php endforeach ?>
            </div>
          </main>
        </div>
      <?php elseif ($v['activity_type'] == 8): ?>
        <div class="eight_adv">
          <main>
            <ul>
              <?php foreach ($v['activity_data'] as $v1): ?>
                <li class="inner_shadow">
                  <a class="adv_wrapper" <?php if((empty($v1['url']))):?>href="javascript:void(0)"<?php else:?>href="<?= $v1['url'] ?>"<?php endif;?> target="_blank">
                    <p>
                      <img src="<?= $v1['cover'] ?>" alt=""/>
                    </p>
                  </a>
                </li>
              <?php endforeach ?>
            </ul>
          </main>
        </div>
      <?php endif; ?>
    <?php endforeach; ?>
  <?php endif; ?>
</div>
<div class="around_adv">
  <?php if (!empty($arround1_ad_data)): ?>
    <div class="around_pic around_pic0">
      <a <?php if((empty($arround1_ad_data[0]['activity_data'][0]['url']))):?>href="javascript:void(0)"<?php else:?>href="<?= $arround1_ad_data[0]['activity_data'][0]['url'] ?>"<?php endif;?> target="_blank">
        <img src="<?= $arround1_ad_data[0]['activity_data'][0]['cover'] ?>" class="around_img" alt=""/>
      </a>
      <div class="close clear">
        <img src="../public/image/index/close.png" alt="" class="right"/>
      </div>
    </div>
  <?php endif; ?>
</div>
<div>
  <div class="index_search">
    <main>
      <div class="clear search">
        <div class="left s0" @click.stop='targetUrl(0)'>
          <img src="../public/image/index/mh_logo.png" alt=""/>
        </div>
        <div class="left s1">
          <div class="s3">
            <form class="layui-form" action="">
              <div class="layui-form-item">
                <div class="layui-input-block">
                  <select name="city" id='search_type'>
                    <option value="1">品牌</option>
                    <option value="2">加盟</option>
                    <option value="3">新闻</option>
                    <option value="4">招聘</option>
                  </select>
                  <input type="text" name="title" id="search_val" class="layui-input search_input" placeholder="请输入关键词">
                  <button type="button" class="search_btn">搜索</button>
                </div>
              </div>
            </form>
          </div>
        </div>
        <div class="right s5">
          <img src="../public/image/index/mh_logo2.png" alt=""/>
        </div>
      </div>
    </main>
  </div>
  <nav>
    <main>
      <ul>
        <li class="selected">
          <a href="javascript:void(0)">
            <b>首页</b>
            <small>HOMEPAGE</small>
          </a>
        </li>
        <li>
          <a href="<?= $conUrl ?>/brand">
            <b>品牌馆</b>
            <small>BRAND HALL</small>
          </a>
        </li>
        <li>
          <a href="<?= $conUrl ?>/join">
            <b>代理加盟</b>
            <small>AGENT ALLIANCE</small>
          </a>
        </li>
        <li>
          <a href="<?= $conUrl ?>/news">
            <b>行业资讯</b>
            <small>NEWS INFORMATION</small>
          </a>
        </li>
        <li>
          <a href="<?= $conUrl ?>/optimal">
            <b>品牌严选</b>
            <small>BRAND OPTIMIZATION</small>
          </a>
        </li>
        <li>
          <a href="<?= $conUrl ?>/recruit">
            <b>行业招聘</b>
            <small>INDUSTRY RECRUITMENT</small>
          </a>
        </li>
        <li>
          <a href="<?= $conUrl ?>/project">
            <b>加盟分析</b>
            <small>PROJECT RECOMMENDATION</small>
          </a>
        </li>
      </ul>
    </main>
  </nav>
</div>
